package com.juntuo.Enums;

import java.util.Map;

/**
 * 常量类
 * @author Derek
 * @create 2016/12/29
 */
public class Constants {

    private Constants(){}



    public static final String BAIDU_LOCATION_AK="xsnEiLPFKIgRTIsLxAWyaGSqS7UYRq35";
    public static final String BAIDU_LOCATION_URL="http://api.map.baidu.com/geocoder/v2/?location=locationParam&output=json&ak="+BAIDU_LOCATION_AK;

    public static final String BASE_URL="https://180.101.147.89:8743";
    public static final String APP_ID = "pXMTpFnGOFX5jtVycpubtNfZxhEa";
    public static final String APP_SECRET = "HcfuH8iRHS_BF0x2XSqGAzfCt58a";
    public static final String AUTH_URL="/iocm/app/sec/v1.1.0/login";
    public static final String REFRESH_TOKEN_URL="/iocm/app/sec/v1.1.0/refreshToken";
    //注册直连设备 非直连设备不能使用
    public static final String DEVICE_REGISTER_URL="/iocm/app/reg/v1.2.0/devices?appId={appId}";
    public static final String LOGOUT_URL="/iocm/app/sec/v1.1.0/logout";
    public static final String DEVICE_ACTIVE_URL="/iocm/app/reg/v1.1.0/devices/{deviceId}?appId={appId}";
    //删除直连设备 非直连设备不能使用
    public static final String DEVICE_DELETE_URL="/iocm/app/dm/v1.1.0/devices/{deviceId}?appId={appId}&cascade={cascade}";
    public static final String DEVICE_UPDATE_URL="/iocm/app/dm/v1.2.0/devices/{deviceId}?appId={appId}";
    public static final String SUBSCRIBR_URL="/iocm/app/sub/v1.2.0/subscribe";
//    public static final String UNSUBSCRIBR_URL="https://server:port/iocm/app/sub/v1.2.0/subscriptions";
//    public static final String DEVICE_REGISTER_URL="/iocm/app/sec/v1.1.0/refreshToken";
//    public static final String DEVICE_REGISTER_URL="/iocm/app/sec/v1.1.0/refreshToken";
//    public static final String DEVICE_REGISTER_URL="/iocm/app/sec/v1.1.0/refreshToken";
//    public static final String DEVICE_REGISTER_URL="/iocm/app/sec/v1.1.0/refreshToken";


    /*
         * notify Type
         * serviceInfoChanged|deviceInfoChanged|LocationChanged|deviceDataChanged|deviceDatasChanged
         * deviceAdded|deviceDeleted|messageConfirm|commandRsp|deviceEvent|ruleEvent
         */
    public static final String DEVICE_ADDED = "deviceAdded";
    public static final String DEVICE_INFO_CHANGED = "deviceInfoChanged";
    public static final String DEVICE_DATA_CHANGED = "deviceDataChanged";
    public static final String DEVICE_DELETED = "deviceDeleted";
    public static final String MESSAGE_CONFIRM = "messageConfirm";
    public static final String SERVICE_INFO_CHANGED = "serviceInfoChanged";
    public static final String COMMAND_RSP = "commandRsp";
    public static final String DEVICE_EVENT = "deviceEvent";
    public static final String RULE_EVENT = "ruleEvent";
    public static final String DEVICE_DATAS_CHANGED = "deviceDatasChanged";

    public static final String QUERY_DEVICE_DATA = BASE_URL + "/iocm/app/dm/v1.3.0/devices";
    public static final String QUERY_DEVICES = BASE_URL + "/iocm/app/dm/v1.3.0/devices";
    public static final String QUERY_DEVICE_HISTORY_DATA = BASE_URL + "/iocm/app/data/v1.1.0/deviceDataHistory";




    public static final String POST_ASYN_CMD = BASE_URL + "/iocm/app/cmd/v1.4.0/deviceCommands";
    /*
    *IP and port of callback url.
    *please replace the IP and Port of your Application deployment environment address, when you use the demo.
    */
    public static final String CALLBACK_BASE_URL = "https://47.98.169.190:443";
//    public static final String CALLBACK_BASE_URL = "https://124.43.67.1:443";


    /*
     * complete callback url：
     * please replace uri, when you use the demo.
     */
    public static final String DEVICE_ADDED_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/device/add";
    public static final String DEVICE_INFO_CHANGED_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/updateDeviceInfo";
    public static final String DEVICE_DATA_CHANGED_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/device/data";
    public static final String DEVICE_DELETED_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/deletedDevice";
    public static final String MESSAGE_CONFIRM_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/commandConfirmData";
    public static final String SERVICE_INFO_CHANGED_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/updateServiceInfo";
    public static final String COMMAND_RSP_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/commandRspData";
    public static final String DEVICE_EVENT_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/DeviceEvent";
    public static final String RULE_EVENT_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/RulEevent";
    public static final String DEVICE_DATAS_CHANGED_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/updateDeviceDatas";

    public static final String REPORT_CMD_EXEC_RESULT_CALLBACK_URL = CALLBACK_BASE_URL + "/callback/reportCmdExecResult";
    /*
   * request header
   * 1. HEADER_APP_KEY
   * 2. HEADER_APP_AUTH
   */
    public static final String HEADER_APP_KEY = "app_key";
    public static final String HEADER_APP_AUTH = "Authorization";


    //Paths of certificates.
    public static String SELFCERTPATH4SUBPUB = "/target/classes/cert/outgoing.CertwithKey.pkcs12";
    public static String TRUSTCAPATH4SUBPUB = "/target/classes/cert/ca.jks";
    public static String SELFCERTPATH = "/cert/outgoing.CertwithKey.pkcs12";
    public static String TRUSTCAPATH = "/cert/ca.jks";

    //Password of certificates.
    public static String SELFCERTPWD = "IoM@1234";
    public static String TRUSTCAPWD = "Huawei@123";

    /**
     * tree的层级
     */
    public static final String TREE_LEVER_ZERO = "0";
    public static final String TREE_LEVER_ONE = "1";
    public static final String TREE_LEVER_TWO = "2";
    public static final String TREE_LEVER_THREE = "3";


    /**
     * 客户的状态 启用的/删除的
     */
    public static final int COMPANY_ACTIVE = 1;
    public static final int COMPANY_DELETED = 0;

    /**
     * 角色的类型
     */
    public static final int ROLE_ADMIN = 0;
    public static final int ROLE_JUNTUO = 1;
    public static final int ROLE_COMPANY = 2;

}
